package org.okwangxing.osgi.provider;

import org.okwangxing.osgi.provider.able.HelloWorldService;
import org.okwangxing.osgi.provider.impl.HelloWorldServiceImpl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

public class ProviderActivator implements BundleActivator {
	private ServiceRegistration registration;

	@Override
	public void start(BundleContext bundleContext) throws Exception {
		registration = bundleContext.registerService(HelloWorldService.class.getName(), new HelloWorldServiceImpl(), null);
	}

	@Override
	public void stop(BundleContext bundleContext) throws Exception {
		registration.unregister();
	}
}